<template>
  <div>
    <div class="box">
      <img :src="url" alt="" />
    <h4 @click="fn(uname)">{{ uname }}</h4>
    </div>
    
  </div>
</template>

<script>
export default {
  //这里记得写字符串  属性用v-blind 传值
  props: ['url', 'uname'],
  methods:{
    fn(){
      this.$emit('addFn',this.uname)
    }
  }
}
</script>

<style scoped>
.box{
   width: 400px;
  height: 300px;
  float: left;
  border: 4px solid #000;
  box-sizing: border-box;
}
img{
  width: 350px;
  height: 250px;
}
</style>>
</style>
